// 通货相关 API
import request from '../utils/request.js';

// 获取通货列表
export const getCurrencyList = () => {
  return request({
    url: '/api/currency/list',
    method: 'GET'
  });
};

// 获取通货详情
export const getCurrencyDetail = (id) => {
  return request({
    url: `/api/currency/detail/${id}`,
    method: 'GET'
  });
};

// 获取价格历史
export const getCurrencyPriceHistory = (id, days = 7) => {
  return request({
    url: `/api/currency/price-history/${id}`,
    method: 'GET',
    data: { days }
  });
};

// 搜索通货
export const searchCurrency = (keyword) => {
  return request({
    url: '/api/currency/search',
    method: 'GET',
    data: { keyword }
  });
};